//有理数
//负责人：贺镇涛 姚凯文
#include<iostream>
#include"myNumer.h"
using namespace std;
#define scanf scanf_s
#include"high-calculate.h"
//精确的有理数实现
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
long long unsigned int mygcd(long long unsigned int a, long long unsigned int b)//等到写了运算的时候改
{
	return a % b ? mygcd(a, b) : b;
}
class myNumer
{
public:
	myNumer(string input);
	myNumer();//默认构造函数
	myNumer operator+(myNumer a,myNumer b);
private:
	string numerator;//分子
	string denominator;//分母
	bool fuhao = 0;		//符号
	void simplify();		//通过化简来支持小数
};

myNumer::myNumer(string input)
{
	size_t frac_bar = input.find('/');		//获得分数线位置
	numerator = input.substr(0, frac_bar);	//截取字符
	if (frac_bar >= input.size()) { denominator = "1"; }
	else denominator = input.substr(frac_bar + 1);//截取字符
	if (denominator[0] == '-') { fuhao = !fuhao; denominator = denominator.substr(1); }
	if (numerator[0] == '-') { fuhao = !fuhao; numerator = numerator.substr(1); }
	simplify();
}

myNumer::myNumer()
{
	numerator = "0";
	denominator = "0";
}

myNumer myNumer::operator+(myNumer a)
{
	return myNumer();
}


void myNumer::simplify()
{
	size_t dot_positionN = numerator.find('.');//分子中小数点位置
	if (dot_positionN <= numerator.size())
	{
		numerator.erase(dot_positionN, 1);//去除小数点
	}
	else dot_positionN = numerator.size();
	size_t dot_positionD = denominator.find('.');//分母中小数点位置
	if (dot_positionD <= numerator.size())
	{
		denominator.erase(dot_positionD, 1);//去除小数点
	}
	else dot_positionD = denominator.size();

	int times = numerator.size() - dot_positionN - (denominator.size() - dot_positionD);
	if (times >= 0) { denominator.append(times, '0'); }//分母乘10^times倍
	else
	{
		times = abs(times);
		numerator.append(times, '0');
	}
	/*
	long long unsigned int tnum = atoi(numerator.c_str());
	long long unsigned int tden = atoi(denominator.c_str());
	long long unsigned int temp = mygcd(tnum, tden);
	tnum = tnum / temp;
	tden = tden / temp;
	numerator = to_string(tnum);
	denominator = to_string(tden);*/
	cout << times << " " << numerator << " " << denominator;
}

//任意位数正整数的加法（高精度运算）
string snumplus(string a, string b)
{
	return 0;
}
string snumminus()
{
	return 0;
}
string snummulti()
{
	return 0;
}
string snumdev()
{

}

int main()
{
	string s;
	cin >> s;
	myNumer a(s);
}

